package com.bwie.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.bwie.pojo.User;
import com.bwie.service.UserService;
import com.bwie.vo.LoginInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Description
 * @Author 36167
 * @Date 2025/3/6 9:16
 **/

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/login")
    public R login( LoginInfoVo loginInfoVo){
        return userService.login(loginInfoVo);
    }

    @PostMapping("/show/{uid}")
    public R show(@PathVariable Integer uid){
      User user= userService.show(uid);
      return R.ok(user);
    }

}
